home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / pcw.zip / QFILL.C < prev    next >
Text File  |  1990-01-16  |  2KB  |  44 lines

  1. /***********************************************************/
  2. /* File Id.                  Qfill.C                       */
  3. /* Author.                   Stan Milam.                   */
  4. /* Date Written.             11/06/88.                     */
  5. /* Modifications:                                          */
  6. /* 11/13/88 - Changed function & file name to wfill        */
  7. /*                                                         */
  8. /*              (c) Copyright by Stan Milam                */
  9. /*                                                         */
  10. /* Comments:  This routine will color in a text block on   */
  11. /* screen via an assembler routine.                        */
  12. /***********************************************************/
  13.  
  14. #include <dos.h>
  15. #include "pcw.i"
  16. #include "pcwproto.h"
  17.  
  18. int qfill(int urow,int ucol,int lrow,int lcol,int fcolor,int bcolor,int ch) {
  19.  
  20.    int rows, cols, attr;
  21.    int page, pagesize;
  22.    int mx_rows, mx_cols;
  23.    int far *scrnptr;
  24.    unsigned offset, scrnseg;
  25.  
  26.    if (!chk_video_state(&mx_rows, &mx_cols)) return(0);
  27.  
  28.    rows = (lrow - urow) + 1;                 /* Calc number of rows */
  29.    cols = (lcol - ucol) + 1;                 /* Calc number of cols */
  30.    ch   &= 0x00ff;
  31.  
  32.    scrnseg = getscrnseg();
  33.    page    = getpage();
  34.    pagesize= getpagesize();
  35.  
  36.    offset  = MK_SCRNOFF(urow, ucol);         /* Make offset to scrn memory */
  37.    scrnptr = (int far *) MK_FP(scrnseg,offset); /* Make far pointer to scrn */
  38.    attr    = MK_ATTR(fcolor,bcolor) + ch;    /* fill with colored chars */
  39.    TextFill(rows, cols, scrnptr, attr);      /* Call assembler function */
  40.    return(1);
  41. }
  42.  
  43.  
  44.